package time.providers.base.api;
import time.compiler.query.Solver;
import time.compiler.query.solvers.Build;

/**
 * This is the most important class for the solver. It will 
 * @author waneck
 */

@:timeApi(DBToMany($A), 
{
	function map<B>(fn:A->B):DBToMany<B> {}
	function filter(fn:A->Bool):DBToMany<A> {}
//	function mapFilter<B>(fn:A->Null<B>):Query<B>; //TODO
	function sum(acessor:A->Float):Float {}
	function avg(acessor:A->Float):Float {}
	function max(acessor:A->Float):Float {}
	function min(acessor:A->Float):Float {}
	function count():Int {}
	function orderBy(acessor:A->Float, asc:Bool = true, ?repeat):DBToMany<A> {} //TODO
	//function view<Key,Value>(fn:A->{key:Key, value:Value}):DatabaseView<Key, Value>; //TODO
	function exists(fn:A->Bool):Bool {}
	function all(fn:A->Bool):Bool {}
	function first<A>():A {}
	function last<A>():A {}
	function get(index:Int):A {}
})
class ToManyApi<A> extends Solver
{
	public function new()
	{
		super();
		
		//Yes, we will need to manually call Build.solver() on each of the classes that extend Solver.
		//Why is that? Because autoBuild won't work on the macro side
		Build.solver();
	}
}